<%@page import="cn.edu.pku.wxlib.book.model.*" %>

<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib tagdir="/WEB-INF/tags/simpletable" prefix="simpletable"%>
<%@ include file="/commons/taglibs.jsp" %>

<rapid:override name="head">
	<title>Book维护</title>
	
	<script src="${ctx}/scripts/rest.js" ></script>
	<link href="<c:url value="/widgets/simpletable/simpletable.css"/>" type="text/css" rel="stylesheet">
	<script type="text/javascript" src="<c:url value="/widgets/simpletable/simpletable.js"/>"></script>
	
	<script type="text/javascript" >
		$(document).ready(function() {
			window.simpleTable = new SimpleTable('queryForm',${page.thisPageNumber},${page.pageSize},'${pageRequest.sortColumns}');
		});
	</script>
</rapid:override>

<rapid:override name="content">
	<form id="queryForm" name="queryForm" method="get" style="display: inline;">
	<div class="queryPanel">
		<fieldset>
			<table>
				<div class="form-group inline">
					<label>图数编号[举个栗子G624.53/200(2009)]</label>	
					<input placeholder="请输入图数编号[举个栗子G624.53/200(2009)]" value="${query.bookNumber}" id="bookNumber" name="bookNumber" maxlength="17"  class="form-field"/>
					<br/>
				</div>
				<div class="form-group inline">
					<label>国际标准图书编号</label>	
					<input placeholder="请输入国际标准图书编号" value="${query.isbn}" id="isbn" name="isbn" maxlength="13"  class="form-field"/>
					<br/>
				</div>
				<div class="form-group inline">
					<label>书名</label>	
					<input placeholder="请输入书名" value="${query.bookName}" id="bookName" name="bookName" maxlength="128"  class="form-field"/>
					<br/>
				</div>
				<div class="form-group inline">
					<label>作者</label>	
					<input placeholder="请输入作者" value="${query.author}" id="author" name="author" maxlength="32"  class="form-field"/>
					<br/>
				</div>
				<div class="form-group inline">
					<label>译者</label>	
					<input placeholder="请输入译者" value="${query.translator}" id="translator" name="translator" maxlength="32"  class="form-field"/>
					<br/>
				</div>
				<div class="form-group inline">
					<label>简介</label>	
					<input placeholder="请输入简介" value="${query.brief}" id="brief" name="brief" maxlength="1024"  class="form-field"/>
					<br/>
				</div>
				<div class="form-group inline">
					<label>出版社</label>	
					<input placeholder="请输入出版社" value="${query.publisher}" id="publisher" name="publisher" maxlength="64"  class="form-field"/>
					<br/>
				</div>
				<div class="form-group inline">
					<label>版本</label>	
					<input placeholder="请输入版本" value="${query.edition}" id="edition" name="edition" maxlength="16"  class="form-field"/>
					<br/>
				</div>
				<div class="form-group inline">
					<label>印次</label>	
					<input placeholder="请输入印次" value="${query.printNumber}" id="printNumber" name="printNumber" maxlength="32"  class="form-field"/>
					<br/>
				</div>
				<div class="form-group inline">
					<label>价格</label>	
					<input placeholder="请输入价格" value="${query.price}" id="price" name="price" maxlength="22"  class="form-field"/>
					<br/>
				</div>
				<div class="form-group inline">
					<label>语言</label>	
					<input placeholder="请输入语言" value="${query.booklanguage}" id="booklanguage" name="booklanguage" maxlength="32"  class="form-field"/>
					<br/>
				</div>
				<div class="form-group inline">
					<label>出版时间</label>	
					<input type="text" value="<fmt:formatDate value='${query.publishTimeBegin}' pattern='<%=Book.FORMAT_PUBLISH_TIME%>'/>" id="publishTimeBegin" name="publishTimeBegin" class="query-date-picker"  />
					<strong>至</strong>
					<input type="text" value="<fmt:formatDate value='${query.publishTimeEnd}' pattern='<%=Book.FORMAT_PUBLISH_TIME%>'/>"  id="publishTimeEnd" name="publishTimeEnd" class="query-date-picker"   />
					<br/>
				</div>
				<div class="form-group inline">
					<label>图书类型ID</label>	
					<input placeholder="请输入图书类型ID" value="${query.categoryId}" id="categoryId" name="categoryId" maxlength="10"  class="form-field"/>
					<br/>
				</div>
				<div class="form-group inline">
					<label>备注</label>	
					<input placeholder="请输入备注" value="${query.note}" id="note" name="note" maxlength="256"  class="form-field"/>
					<br/>
				</div>
				<div class="form-group inline">
					<label>入库数量</label>	
					<input placeholder="请输入入库数量" value="${query.storageTotalNumber}" id="storageTotalNumber" name="storageTotalNumber" maxlength="10"  class="form-field"/>
					<br/>
				</div>
				<div class="form-group inline">
					<label>可外借数量</label>	
					<input placeholder="请输入可外借数量" value="${query.lendTotalNumber}" id="lendTotalNumber" name="lendTotalNumber" maxlength="10"  class="form-field"/>
					<br/>
				</div>
				<div class="form-group inline">
					<label>用途[1工具书/2教科书/3其它]</label>	
					<input placeholder="请输入用途[1工具书/2教科书/3其它]" value="${query.bookusage}" id="bookusage" name="bookusage" maxlength="10"  class="form-field"/>
					<br/>
				</div>
				<div class="form-group inline">
					<label>来源</label>	
					<input placeholder="请输入来源" value="${query.source}" id="source" name="source" maxlength="64"  class="form-field"/>
					<br/>
				</div>
			</table>
			<button type="button" class="btn btn-default" onclick="getReferenceForm(this).action='${ctx}/book'">查询</button>
		</fieldset>
		<div class="handleControl">
			<button type="button" class="btn btn-default" onclick="window.location = '${ctx}/book/new'">新增</button>
			<button type="button" class="btn btn-default" onclick="doRestBatchDelete('${ctx}/book','items',document.forms.queryForm)">删除</button>
	</div>
	
	<div class="gridTable">	
		<table width="120%"  border="0" cellspacing="0" class="table text-center">
		  <thead>			  
			  <tr>
				<th style="width:1px;"><input type="checkbox" onclick="setAllCheckboxState('items',this.checked)"></th>
				<th sortColumn="bookNumber" >图数编号[举个栗子G624.53/200(2009)]</th>
				<th sortColumn="ISBN" >国际标准图书编号</th>
				<th sortColumn="bookName" >书名</th>
				<th sortColumn="author" >作者</th>
				<th sortColumn="translator" >译者</th>
				<th sortColumn="brief" >简介</th>
				<th sortColumn="publisher" >出版社</th>
				<th sortColumn="edition" >版本</th>
				<th sortColumn="printNumber" >印次</th>
				<th sortColumn="price" >价格</th>
				<th sortColumn="booklanguage" >语言</th>
				<th sortColumn="publishTime" >出版时间</th>
				<th sortColumn="categoryId" >图书类型ID</th>
				<th sortColumn="note" >备注</th>
				<th sortColumn="storageTotalNumber" >入库数量</th>
				<th sortColumn="lendTotalNumber" >可外借数量</th>
				<th sortColumn="bookusage" >用途[1工具书/2教科书/3其它]</th>
				<th sortColumn="source" >来源</th>
				<th style="white-space:nowrap;" colspan="3">操作</th>
			  </tr>			  
		  </thead>
		  <tbody>
		  	  <c:forEach items="${page.result}" var="item" varStatus="status">
			  <tr class="${status.count % 2 == 0 ? 'odd' : 'even'}">
				<td><input type="checkbox" name="items" value="${item.bookId}"></td>
				<td><c:out value='${item.bookNumber}'/>&nbsp;</td>
				<td><c:out value='${item.isbn}'/>&nbsp;</td>
				<td><c:out value='${item.bookName}'/>&nbsp;</td>
				<td><c:out value='${item.author}'/>&nbsp;</td>
				<td><c:out value='${item.translator}'/>&nbsp;</td>
				<td><c:out value='${item.brief}'/>&nbsp;</td>
				<td><c:out value='${item.publisher}'/>&nbsp;</td>
				<td><c:out value='${item.edition}'/>&nbsp;</td>
				<td><c:out value='${item.printNumber}'/>&nbsp;</td>
				<td><c:out value='${item.price}'/>&nbsp;</td>
				<td><c:out value='${item.booklanguage}'/>&nbsp;</td>
				<td><c:out value='${item.publishTimeString}'/>&nbsp;</td>
				<td><c:out value='${item.categoryId}'/>&nbsp;</td>
				<td><c:out value='${item.note}'/>&nbsp;</td>
				<td><c:out value='${item.storageTotalNumber}'/>&nbsp;</td>
				<td><c:out value='${item.lendTotalNumber}'/>&nbsp;</td>
				<td><c:out value='${item.bookusage}'/>&nbsp;</td>
				<td><c:out value='${item.source}'/>&nbsp;</td>
				<td>
					<a href="${ctx}/book/${item.bookId}">查看</a>&nbsp;&nbsp;
					<a href="${ctx}/book/${item.bookId}/edit">修改</a>&nbsp;&nbsp;
					<a href="${ctx}/book/${item.bookId}" onclick="doRestDelete(this,'你确认删除?');return false;">删除</a>
				</td>
			  </tr>
			  
		  	  </c:forEach>
		  </tbody>
		</table>
	
		<simpletable:pageToolbar page="${page}">
		</simpletable:pageToolbar>
		
	</div>
	</form>
</rapid:override>
<rapid:override name="script">
	<script></script>
</rapid:override>
<%@ include file="base.jsp" %>
